package com.lmiot.xyclick.Bean.SQL;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

public class SaveVoiceBeanDao extends AbstractDao<SaveVoiceBean, Long> {
    public static final String TABLENAME = "SAVE_VOICE_BEAN";

    public static class Properties {
        public static final Property Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property Voice_detail = new Property(3, String.class, "voice_detail", false, "VOICE_DETAIL");
        public static final Property Voice_id = new Property(1, String.class, "voice_id", false, "VOICE_ID");
        public static final Property Voice_time = new Property(4, String.class, "voice_time", false, "VOICE_TIME");
        public static final Property Voice_type = new Property(2, String.class, "voice_type", false, "VOICE_TYPE");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public SaveVoiceBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public SaveVoiceBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"SAVE_VOICE_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"VOICE_ID\" TEXT UNIQUE ,\"VOICE_TYPE\" TEXT,\"VOICE_DETAIL\" TEXT,\"VOICE_TIME\" TEXT);");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"SAVE_VOICE_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, SaveVoiceBean saveVoiceBean) {
        databaseStatement.clearBindings();
        Long id = saveVoiceBean.getId();
        if (id != null) {
            databaseStatement.bindLong(1, id.longValue());
        }
        String voice_id = saveVoiceBean.getVoice_id();
        if (voice_id != null) {
            databaseStatement.bindString(2, voice_id);
        }
        String voice_type = saveVoiceBean.getVoice_type();
        if (voice_type != null) {
            databaseStatement.bindString(3, voice_type);
        }
        String voice_detail = saveVoiceBean.getVoice_detail();
        if (voice_detail != null) {
            databaseStatement.bindString(4, voice_detail);
        }
        String voice_time = saveVoiceBean.getVoice_time();
        if (voice_time != null) {
            databaseStatement.bindString(5, voice_time);
        }
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, SaveVoiceBean saveVoiceBean) {
        sQLiteStatement.clearBindings();
        Long id = saveVoiceBean.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        String voice_id = saveVoiceBean.getVoice_id();
        if (voice_id != null) {
            sQLiteStatement.bindString(2, voice_id);
        }
        String voice_type = saveVoiceBean.getVoice_type();
        if (voice_type != null) {
            sQLiteStatement.bindString(3, voice_type);
        }
        String voice_detail = saveVoiceBean.getVoice_detail();
        if (voice_detail != null) {
            sQLiteStatement.bindString(4, voice_detail);
        }
        String voice_time = saveVoiceBean.getVoice_time();
        if (voice_time != null) {
            sQLiteStatement.bindString(5, voice_time);
        }
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public SaveVoiceBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        int i6 = i + 4;
        return new SaveVoiceBean(valueOf, string, string2, cursor.isNull(i5) ? null : cursor.getString(i5), cursor.isNull(i6) ? null : cursor.getString(i6));
    }

    public void readEntity(Cursor cursor, SaveVoiceBean saveVoiceBean, int i) {
        int i2 = i + 0;
        String str = null;
        saveVoiceBean.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        saveVoiceBean.setVoice_id(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        saveVoiceBean.setVoice_type(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        saveVoiceBean.setVoice_detail(cursor.isNull(i5) ? null : cursor.getString(i5));
        int i6 = i + 4;
        if (!cursor.isNull(i6)) {
            str = cursor.getString(i6);
        }
        saveVoiceBean.setVoice_time(str);
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(SaveVoiceBean saveVoiceBean, long j) {
        saveVoiceBean.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(SaveVoiceBean saveVoiceBean) {
        if (saveVoiceBean != null) {
            return saveVoiceBean.getId();
        }
        return null;
    }

    public boolean hasKey(SaveVoiceBean saveVoiceBean) {
        return saveVoiceBean.getId() != null;
    }
}
